﻿@model KTD.Web.Models.VD.SalerVD
@{
    ViewBag.Title = "Detail";
}

<style>
    .layui-table th {
        font-weight: bold;
        background-color: #f2f2f2;
        text-align: right;
    }
</style>
@{
    var oldImgRoot = "";
    if (Model.memberId == null || Model.memberId == 0)
    {
        oldImgRoot = "http://wx.attch.we.qsace.com/";
    }
}
<fieldset class="layui-elem-field">
    <legend>基本信息</legend>
    <div class="layui-field-box layui-form">
        <table class="layui-table">
            <tbody>
                <tr>
                    <th>公司(平台)名称</th>
                    <td>@Model.platform</td>
                    <th>姓名</th>
                    <td>@Model.name</td>
                    <th>入驻楼盘</th>
                    <td>@Model.housename</td>
                </tr>
                <tr>
                    <th>手机</th>
                    <td>@Model.tel</td>
                    <th>微信</th>
                    <td>@Model.wechat</td>
                    <th>推荐人手机</th>
                    <td>@Model.ptel</td>
                </tr>
                <tr>
                    <th>活跃</th>
                    <td>@Model.huoyue</td>
                    <th>点赞</th>
                    <td>@Model.zan</td>
                    <th>佣金</th>
                    <td>@Model.money</td>
                </tr>
                <tr>
                    <th>头像</th>
                    <td><img src="@Model.avatar" /></td>
                    <th>二维码</th>
                    <td><img src="@(oldImgRoot+Model.code)" /></td>
                    <th>工牌</th>
                    <td><img src="@(oldImgRoot+Model.gp)" /></td>
                </tr>
            </tbody>
        </table>
        <div class="layui-form-item">
            <label for="L_email" class="layui-form-label" style="width:100px;">
                审核状态
            </label>
            <div class="layui-input-inline">
                @Html.EnumDropDownListFor(model => model.status, new { @class = "layui-input" })

            </div>

            <label for="L_email" class="layui-form-label" style="width:100px;">
                热度
            </label>
            <div class="layui-input-inline">
                @Html.TextBoxFor(model => model.hot, new { @class = "layui_input", type = "number" })

            </div>
            <button id="btnUpdate" class="layui-btn" lay-filter="add" lay-submit="">
                提交
            </button>
        </div>


    </div>
</fieldset>

@section scripts{
    <script>

       $(function () {
            $("#btnUpdate").click(function () {
                $.ajax({

                    url: "/Saler/Update",
                    type: "post",
                    data: { Id: "@ViewBag.Id", Status: $("#status").val(),hot:$("#hot").val()},

                    success: function (data) {
                        if (data.success) {
                            layer.alert("提交成功", { icon: 6 }, function () {
                                // 获得frame索引
                                var index = parent.layer.getFrameIndex(window.name);
                                //关闭当前frame
                                parent.layer.close(index);
                                parent.window.location.reload();
                            });

                        } else {
                            layer.alert("提交失败，"+data.msg, { icon: 1 });
                        }
                    }
                })

            });

        })
    </script>
}